<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Factories\HasFactory;

/**
 * App\Models\Slide
 *
 * @property int $id
 * @property string $position where to show this slide
 * @property string|null $image
 * @property string|null $brief
 * @property string|null $url
 * @property int $is_hidden
 * @property int $order
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @method static \Database\Factories\SlideFactory factory(...$parameters)
 * @method static Builder|Slide newModelQuery()
 * @method static Builder|Slide newQuery()
 * @method static Builder|Slide position($position = 'home_top')
 * @method static Builder|Slide query()
 * @method static Builder|Slide show()
 * @method static Builder|Slide whereBrief($value)
 * @method static Builder|Slide whereCreatedAt($value)
 * @method static Builder|Slide whereId($value)
 * @method static Builder|Slide whereImage($value)
 * @method static Builder|Slide whereIsHidden($value)
 * @method static Builder|Slide whereOrder($value)
 * @method static Builder|Slide wherePosition($value)
 * @method static Builder|Slide whereUpdatedAt($value)
 * @method static Builder|Slide whereUrl($value)
 * @mixin \Eloquent
 * @property int $is_shown
 * @method static Builder|Slide whereIsShown($value)
 */
class Slide extends Model
{
    use HasFactory;
	
	protected $guarded = ['id'];
	
	public function scopePosition(Builder $builder, $position = 'home_top')
	{
		return $builder->where('position', $position);
	}
	
	public function scopeShow(Builder $builder)
	{
		return $builder->where('is_hidden', false);
	}
}
